Skip to content

Comments

feat: Add OpenAPI docs plugin with auto-generated API reference#25

Merged
druid-infra merged 5 commits intomasterfrom
feat/openapi-docs-plugin
Feb 10, 2026
Merged

feat: Add OpenAPI docs plugin with auto-generated API reference#25
druid-infra merged 5 commits intomasterfrom
feat/openapi-docs-plugin

Conversation

@druid-infra
Copy link
Contributor

Summary

Implements automatic API documentation generation from the druid-cli OpenAPI spec.

Changes

  • ✅ Upgraded Docusaurus from 3.2.1 to 3.9.2
  • ✅ Installed docusaurus-plugin-openapi-docs v4.7.1
  • ✅ Installed docusaurus-theme-openapi-docs v4.7.1
  • ✅ Added openapi.yaml from druid-cli repository
  • ✅ Configured plugin to generate docs in docs/cli/
  • ✅ Added API link to navbar → /cli
  • ✅ Generated 80+ API endpoint pages from OpenAPI spec
  • ✅ Grouped endpoints by tag (scroll, logs, metrics, process, coldstarter, etc.)

Features

  • Auto-generated docs: All API endpoints are generated from openapi.yaml
  • Interactive: Users can see request/response schemas, examples, authentication
  • Organized: Endpoints grouped by functionality (scroll, logs, metrics, etc.)
  • Searchable: Integrated with Algolia search
  • Maintainable: Run bun run gen-api-docs to regenerate when openapi.yaml changes

Build Status

✅ Build passes successfully with only non-critical warnings (blog truncation, pre-existing German translation anchors)

Preview

After merge, API docs will be available at: https://docs.druid.gg/cli

Related

Testing

bun install
bun run build
bun run serve
# Visit http://localhost:3000/cli

- Upgrade Docusaurus from 3.2.1 to 3.9.2
- Install docusaurus-plugin-openapi-docs v4.7.1
- Install docusaurus-theme-openapi-docs v4.7.1
- Add openapi.yaml from druid-cli repository
- Configure plugin to generate docs in docs/cli/
- Add API link to navbar
- Generate 80+ API endpoint pages from OpenAPI spec
- Group endpoints by tag (scroll, logs, metrics, process, coldstarter, etc.)
- Add docItemComponent configuration for ApiItem theme
- Set slug for druid-cli.info.mdx to /cli for proper routing
- Update deps: React 18.3.1, TypeScript 5.9.3, clsx 2.1.1

The API docs are now automatically generated from the OpenAPI spec and
will stay in sync with druid-cli changes. Run 'bun run gen-api-docs'
to regenerate docs when openapi.yaml is updated.
@druid-infra
Copy link
Contributor Author

Error: This repo is not allowlisted for Atlantis.

@cloudflare-workers-and-pages
Copy link
Contributor

cloudflare-workers-and-pages bot commented Feb 10, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
docs 79e3c7e Commit Preview URL

Branch Preview URL
Feb 10 2026, 12:59 PM

Lugh (Druid Bot) added 4 commits February 10, 2026 13:36
- Add scripts/fetch-openapi.sh to download latest openapi.yaml from druid-cli
- Update gen-api-docs script to fetch before generating
- Add openapi.yaml to .gitignore (no longer tracked in repo)
- Ensure docs are always in sync with latest druid-cli master
- Prevents stale API documentation

Usage: bun run gen-api-docs
This will automatically fetch the latest spec and regenerate docs.
- Update docs/cli/_category_.json with 'API Reference' label
- Set position to 100 (end of sidebar)
- Set collapsed to false (expanded by default)
- Add category link to druid-cli intro page
- Improves navigation and organization of API documentation
- Move OpenAPI generated docs from docs/cli/ to docs/cli/api/
- Update plugin config outputDir to docs/cli/api
- Create docs/cli/api/_category_.json (API Reference subcategory)
- Set position to 3 (after Commands subcategory)
- Update navbar link from /cli to /cli/api
- Set slug /cli/api on druid-cli.info.mdx

Result: API Reference is now a subcategory inside Druid CLI,
alongside Commands, matching the desired documentation structure.

Directory structure:
- Druid CLI/
  - Introduction, Available Scrolls, Plugins, Scroll
  - Commands/ (existing)
  - API Reference/ (new - all OpenAPI endpoints)
- Set Commands position to 100
- Set API Reference position to 101
- Both subcategories now appear at the end of Druid CLI navigation
@druid-infra druid-infra merged commit cdac259 into master Feb 10, 2026
1 of 2 checks passed
@druid-infra druid-infra deleted the feat/openapi-docs-plugin branch February 10, 2026 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant